package io.geekidea.boot.generator;

import com.hwtx.form.util.translate.TransApi;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;

public class TansUtils {

    public static void main(String[] args) {
        getTableName("sys_user");
    }

    public static void getTableName(String tableName) {
        try {
            TransApi transApi = new TransApi();
            Path path = Paths.get(Objects.requireNonNull(TansUtils.class.getClassLoader().getResource("trans.txt")).getFile());
            Files.readAllLines(path, StandardCharsets.UTF_8).forEach(line -> {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println(transApi.getEnTransResult(line));
            });
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
